package org.robby.cdr.actions;

import java.util.List;
import java.util.Map;

import org.robby.hbase.cdr.CdrPro;
import org.robby.hbase.cdr.HbaseCdrIF;

import com.opensymphony.xwork2.ActionSupport;

public class CdrAction extends ActionSupport {

	String addr;
	List<CdrPro.SmCdr> cdrs;
	Map<String,Integer> dailyReport;

	public String execute() throws Exception {
		HbaseCdrIF hif = HbaseCdrIF.getInstance();
		cdrs = hif.getSmCdr(addr);
		return SUCCESS;
	}
	
	public String cdrdaily() throws Exception {
		HbaseCdrIF hif = HbaseCdrIF.getInstance();
		dailyReport = hif.getDailyReport();
		System.out.println(dailyReport.size());
		return SUCCESS;
	}

	public String getAddr() {
		return addr;
	}

	public void setAddr(String addr) {
		this.addr = addr;
	}

	public List<CdrPro.SmCdr> getCdrs() {
		return cdrs;
	}

	public void setCdrs(List<CdrPro.SmCdr> cdrs) {
		this.cdrs = cdrs;
	}

	public Map<String, Integer> getDailyReport() {
		return dailyReport;
	}

	public void setDailyReport(Map<String, Integer> dailyReport) {
		this.dailyReport = dailyReport;
	}
}
